Skip to content

Conversation

@chargome
Copy link
Member

Adds a shim for the logger namespace since we'll soon ship the logs bundle in the loader and want to avoid breaking user apps when they switch back to a bundle that does not include logs

closes #18826

@chargome chargome self-assigned this Jan 15, 2026
@linear
Copy link

linear bot commented Jan 15, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.11 kB - -
@sentry/browser - with treeshaking flags 23.61 kB - -
@sentry/browser (incl. Tracing) 41.86 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.45 kB - -
@sentry/browser (incl. Tracing, Replay) 80.46 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.15 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.17 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.36 kB - -
@sentry/browser (incl. Feedback) 41.83 kB - -
@sentry/browser (incl. sendFeedback) 29.79 kB - -
@sentry/browser (incl. FeedbackAsync) 34.79 kB - -
@sentry/browser (incl. Metrics) 26.21 kB - -
@sentry/browser (incl. Logs) 26.37 kB - -
@sentry/browser (incl. Metrics & Logs) 27.02 kB - -
@sentry/react 26.84 kB - -
@sentry/react (incl. Tracing) 44.08 kB - -
@sentry/vue 29.56 kB - -
@sentry/vue (incl. Tracing) 43.67 kB - -
@sentry/svelte 25.12 kB - -
CDN Bundle 27.67 kB +0.23% +61 B 🔺
CDN Bundle (incl. Tracing) 42.67 kB +0.18% +74 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 43.5 kB - -
CDN Bundle (incl. Tracing, Replay) 79.37 kB +0.1% +76 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 84.8 kB +0.11% +91 B 🔺
CDN Bundle - uncompressed 81.08 kB +0.24% +187 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 126.49 kB +0.15% +187 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 129.32 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 243.03 kB +0.08% +187 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 255.83 kB +0.08% +197 B 🔺
@sentry/nextjs (client) 46.43 kB - -
@sentry/sveltekit (client) 42.24 kB - -
@sentry/node-core 51.91 kB +0.01% +1 B 🔺
@sentry/node 162.16 kB - -
@sentry/node - without tracing 93.33 kB - -
@sentry/aws-serverless 108.83 kB -0.01% -1 B 🔽

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,983 - 9,330 -4%
GET With Sentry 1,782 20% 1,710 +4%
GET With Sentry (error only) 6,227 69% 5,930 +5%
POST Baseline 1,219 - 1,204 +1%
POST With Sentry 610 50% 595 +3%
POST With Sentry (error only) 1,071 88% 1,051 +2%
MYSQL Baseline 3,391 - 3,209 +6%
MYSQL With Sentry 519 15% 482 +8%
MYSQL With Sentry (error only) 2,733 81% 2,619 +4%

View base workflow run

@chargome chargome marked this pull request as ready for review January 16, 2026 10:55
@chargome chargome requested review from Lms24 and andreiborza January 16, 2026 10:56
Comment on lines 46 to 49
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn('You are using consoleLoggingIntegration() even though this bundle does not include logs.');
});
Copy link
Member

@Lms24 Lms24 Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I know we also do this in other shims but I'm wondering if we should instead guard these logs with DEBUG_BUILD. My thinking is:

  • We export dedicated .debug bundle variants
  • When using the loader, users can toggle debug logging
  • End users should probably not get these warnings in their console, just because our users decided to not use the feature. This is especially relevant for the loader use case.
  • This helps keep the CDN bundle size increase at a minimum, since we can tree-shake out the logs for the normal bundles

WDYT? Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense, I'll update that

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@chargome chargome enabled auto-merge (squash) January 16, 2026 15:37
@chargome chargome requested a review from Lms24 January 16, 2026 15:37
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@chargome chargome merged commit e50b75c into develop Jan 16, 2026
210 checks passed
@chargome chargome deleted the cg/JS-1469/export-logsmetric-shims branch January 16, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export logs+metric shims

3 participants